var tool = {
    formatDate: function (time) {
        var date = new Date(time);

        var year = date.getFullYear(),
            month = date.getMonth() + 1,//月份是从0开始的
            day = date.getDate();
        // hour = date.getHours(),
        // min = date.getMinutes(),
        // sec = date.getSeconds();
        var newTime = year + '-' +
            (month < 10 ? '0' + month : month) + '-' +
            (day < 10 ? '0' + day : day);
        // (hour < 10 ? '0' + hour : hour) + ':' +
        // (min < 10 ? '0' + min : min) + ':' +
        // (sec < 10 ? '0' + sec : sec);
        return newTime;
    },
    reEChartTrade: function (trade, data) {
        var data2 = [];
        for (var date in trade) {
            // var item = {name: "mark"};
            // let date = tool.formatDate(i);
            var item = {
                name: 'Mark',
                coord: [date, data[date][2]],
                value: (trade[date] > 0 ? "1" : "-1"),
                itemStyle: {
                    color: trade[date] > 0 ? "yellow" : "blue"
                }
            };
            data2.push(item);
        }
        return data2;
    }
}
// var tool=new Tool();
// export tool;